package headfirst.decorater;

import java.util.ArrayList;
import java.util.HashMap;

public class TimeSortedSearchResult extends SortedSearchResult
{
	public TimeSortedSearchResult(SearchResult slist)
	{
		this.unsortedSearchResult = slist;
	}
	
	public ArrayList< HashMap<String, String> > getSortedList()
	{
		System.out.println("in TimeSortedSearchResult, call getSortedList");
		
		ArrayList< HashMap<String, String> > sourceList = this.unsortedSearchResult.getSortedList();
		
		ArrayList< HashMap<String, String> > deslist = new ArrayList< HashMap<String, String> >();
		if(null != sourceList)
		{
			for(int i =0; i<sourceList.size(); ++i)
			{
				deslist.add(sourceList.get(i));
			}
		}
		return deslist;
	}
}